package com.wzq.solution;

class Solution220 {
    public boolean containsNearbyAlmostDuplicate(int[] nums, int k, int t) {
       
        
        
        for(int i=0;i<nums.length;i++){
            int j = i-k;
            j = j>=0?j:0;
            for(;j<i;j++){
                long tmp = Long.valueOf(nums[i])-Long.valueOf(nums[j]);
                tmp = tmp<0?0-tmp:tmp;

                if(tmp <= t){
                    return true;
                }
            }
        }
        return false;
    }


    public static void main(String[] args) {
        new Solution220().containsNearbyAlmostDuplicate(new int[]{2147483647,-2147483647},1,2147483647);
    }
}